#!/bin/sh
# This regression test is a part of SIPp.
# A new call tries every free -tdmmap circuit, the last one too: with
# three circuits and three calls at a time, a new call always finds the
# one its predecessor gave back, whatever circuit the search starts at.
. "`dirname "$0"`/../functions"; init

calls=90
sippbg -sn uas -i 127.0.0.1 -p 25632 -m $calls -timeout 30
sippfg -sn uac -i 127.0.0.1 -p 25633 127.0.0.1:25632 -m $calls -l 3 \
    -r 1000 -d 20 -tdmmap '{0-0}{1}{0-0}{0-2}' -timeout 30 \
    -timeout_error >/dev/null 2>&1
status=$?

if test $status -ne 0; then
    fail "the calls failed with $status"
else
    ok
fi
